Skip to content

Instantly share code, notes, and snippets.

@jasaca
jasaca / gistSQLinjection.php
Created July 2, 2026 16:47
Script per evitar SQL Injections
<?php
// Funció de filtrat universal
function f($d) {
if (is_array($d)) return array_map('f', $d);
return htmlspecialchars(strip_tags(trim($d)), ENT_QUOTES, 'UTF-8');
}
// Funció per camps numèrics
function fn($d) {
return ctype_digit($d) ? (int)$d : 0;
@k16shikano
k16shikano / SKILL.md
Last active July 2, 2026 17:17
japanese-tech-writing/SKILL
name japanese-tech-writing
description 日本語の技術文書・書籍原稿の文章規範。整形(一文一行、引用ブロック、脚注、コラム記法)、段落と論証の構成(パラグラフライティング)、論証の厳密さ(ツッコミどころの除去)、読み手の負荷の管理、視点と語り、演出の抑制、LLM っぽい空句の禁止、冗長の排除を定める。日本語で技術書の章、草稿、記事、解説文を書くとき、または推敲・リライトするときに使用する。

日本語技術文書の文章規範

日本語で技術的な原稿(書籍の章、記事、解説文)を書く・推敲するときは、以下の規範に従う。

整形

@kueda
kueda / d3.phylogram.js
Last active July 2, 2026 17:16
Right-angle phylograms and circular dendrograms with d3. To preview see http://bl.ocks.org/kueda/1036776
/*
d3.phylogram.js
Wrapper around a d3-based phylogram (tree where branch lengths are scaled)
Also includes a radial dendrogram visualization (branch lengths not scaled)
along with some helper methods for building angled-branch trees.
Copyright (c) 2013, Ken-ichi Ueda
All rights reserved.
@mizchi
mizchi / formal-methods-playbook.md
Created July 2, 2026 14:29
実装コードから仕様を吸い出して Z3 / TLA+ でバグを払い出す — 実践プレイブック

実装コードから仕様を吸い出して Z3 / TLA+ でバグを払い出す — 実践プレイブック

既存システムの実装を「事実上の仕様」とみなし、それを形式化することで 「テストでは踏めないバグ」と「実装が暗黙に決めている仕様」を炙り出すための手順書。 仕様書が無い / あてにならない / 仕様と実装がずれている、という現場を前提にする。


0. 基本姿勢: コードが de-facto 仕様である

@willurd
willurd / web-servers.md
Last active July 2, 2026 17:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@branzo
branzo / cam_ptz.sh
Created May 23, 2026 09:32 — forked from rm1138/cam_ptz.sh
eMeet Pixy (328f:00c0) PTZ and HID control for Linux - reverse-engineered tracking, privacy, gesture, and audio mode commands
#!/usr/bin/env bash
# PTZ and mode control for eMeet Pixy webcam (USB 328f:00c0)
# Uses v4l2-ctl for PTZ and HID for tracking/idle mode
# Usage: cam_ptz.sh <command> [value]
#
# --- How the HID protocol was reverse-engineered ---
#
# The eMeet Pixy exposes two control interfaces:
# 1. UVC (standard) — pan/tilt/zoom/focus via v4l2-ctl
# 2. HID (proprietary) — tracking, audio, gesture, privacy via /dev/hidrawN
@vukrosic
vukrosic / 00_README.md
Created June 30, 2026 01:57
PTRM: how a 7M-parameter model beats frontier LLMs on reasoning puzzles (summary by Vuk Rosić)

PTRM: how a 7-million-parameter model beats frontier LLMs on reasoning puzzles

A plain-language writeup by Vuk Rosić of the paper "Probabilistic Tiny Recursive Model" (Sghaier, Parviz & Jolicoeur-Martineau, Mila — arXiv:2605.19943). Independent summary, not affiliated with or endorsed by the authors.

A 7-million-parameter model just beat an ensemble of 7 frontier LLMs on reasoning puzzles — about 10,000× cheaper, and with zero retraining.

The problem

Tiny Recursive Models (TRM) solve a puzzle by repeatedly refining a hidden "working state" and their current best answer with the same small two-layer network. But that refinement is deterministic: one input always traces one path, and that path can settle on a wrong answer with no way out. The paper shows many of TRM's failures are runs trapped in a bad "basin" — a region of the hidden space that decodes to a wrong answer and that the deterministic loop can't escape.

@letanure
letanure / estados-cidades.json
Last active July 2, 2026 17:08
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",